<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="../../assets/css/base.css">
  <style>
    div {
      transform-style: preserve-3d;
      perspective: 1000px;
      transition: all 1s;
    }

    div>div {
      width: 200px;
      height: 200px;
      border: 1px solid black;
      background-color: #17f;
    }

    .translate:hover div {
      /*
        translate(x轴, y轴)
         ● translate 中的百分比相对于当前元素
       */
      transform: translate(100%, 100%);
    }

    .translate-x:hover div {
      transform: translateX(100%);
    }

    .translate-y:hover div {
      transform: translateY(100%);
    }

    .translate-z:hover div {
      transform: translateZ(500px);
    }

    .translate3d:hover div {
      /* translate3d(x轴, y轴, z轴) */
      transform: translate3d(100%, 100%, 500px);
    }
  </style>
</head>

<body>
  <div class="float-left margin-left-10 translate">
    <p class="title">translate</p>
    <div></div>
  </div>

  <div class="float-left margin-left-10 translate-x">
    <p class="title">translateX</p>
    <div></div>
  </div>

  <div class="float-left margin-left-10 translate-y">
    <p class="title">translateY</p>
    <div></div>
  </div>

  <div class="float-left margin-left-10 translate-z">
    <p class="title">translateZ</p>
    <div></div>
  </div>

  <div class="float-left margin-left-10 translate3d">
    <p class="title">translate3d</p>
    <div></div>
  </div>
</body>

</html>